package com.supermap.dialogs;

import com.supermap.dialogs.advance.CJDialog;

import javax.swing.*;
import java.awt.*;

public class InputNameDialog extends CJDialog {
    private JTextField textField;

    public InputNameDialog(Frame owner, String title, boolean modal) {
        super(owner, title, modal, 260, 90, null);
    }

    /**
     * 获取文本框输入内容
     *
     * @return 文本框输入内容
     */
    public String getInputText() {
        return textField.getText();
    }

    @Override
    protected void initializeArgs(Object[] args) {

    }

    @Override
    protected void initializeCore() {
        textField = new JTextField();
        add(textField, BorderLayout.CENTER);
    }

    @Override
    protected void doConfirmCore() {
        setVisible(false);
    }
}
